//Usual Menu
RequireScript("menu.js");
RequireScript("dev_console.js");
var Log = OpenLog("menulog.txt");

function returnTo()
{
	1+1;
}
function exitGame()
{
	ExitMapEngine();
	GarbageCollect();
	RestartGame();
}
function RenderMenu()
{
	
	Log.write("Menu Initialized");
	Log.write("Time: "+GetTime());
	var exit = false;
	RenderMap();
	var map_image = GrabImage(0,0, GetScreenWidth(), GetScreenHeight()); // Get Image
	FlipScreen();
	map_image.blit(0,0);
	Rectangle(0, 0, GetScreenWidth(), GetScreenHeight(), CreateColor(0,0,0, 100));
	var ply_menu = new Menu("PauseMenu",map_image);
	ply_menu.addItem("Return", "Return to Game", returnTo);
	ply_menu.addItem("Dev. Console", "Developer Console, for debugging.", openConsole);
	ply_menu.addItem("Exit", "Exit to Desktop", exitGame);
	ply_menu.execute(200,100,100,60);
	Log.write("Menu Exit");
	Log.write("Time: "+GetTime());
	FlipScreen();
}